Rework permission UI#23959
Conversation
9994903 to
0c6aac3
Compare
There was a problem hiding this comment.
Note: this file should be replaced by proper controllers + templates.
I've added it to the backlog so it can be done separately.
There was a problem hiding this comment.
Note: this file should be replaced by proper controllers + templates.
I've added it to the backlog so it can be done separately.
0c6aac3 to
2e6adc4
Compare
|
Additional review from functional testing: Avoid reloading entire page every time user wants to add visibility targets; it is very annoying. It doesn't reload the page when targets are removed. |
I agree but I wanted to keep changes low here as there are already a lot of lines changed. |
778db7f to
d5c97e2
Compare
|
Rebased for conflicts, there was no others changes. |
cedric-anne
left a comment
There was a problem hiding this comment.
Please rebase to solve conflicts.
| $params['toupdate'] = ['value_fieldname' | ||
| => 'value', | ||
| 'to_update' => "subvisibility$rand", | ||
| 'url' => $CFG_GLPI["root_doc"] . "/ajax/subvisibility.php", | ||
| 'moreparams' => ['items_id' => '__VALUE__', | ||
| 'type' => $_POST['type'], | ||
| 'prefix' => $_POST['prefix'], | ||
| ], | ||
| $params = [ | ||
| 'rand' => $rand, | ||
| 'name' => $prefix . 'groups_id' . $suffix, | ||
| 'width' => '100%', | ||
| 'aria_label' => Group::getTypeName(1), | ||
| ]; |
There was a problem hiding this comment.
I see no related changes in other implementations of CommonDBVisible. Does the feature still works in Reminder and RSSFeed contexts ?
There was a problem hiding this comment.
Indeed, I thought this feature was only used for the KB (I searched for usage and found nothing but now I clearly see that it is used elsewhere, weird).
I'll work on it, probably create some dedicated controllers and twig files for the KB then since the original was heavily modified.
| document.getElementById('kb-permissions-form-{{ rand }}'), | ||
| '{{ rand }}', |
There was a problem hiding this comment.
| document.getElementById('kb-permissions-form-{{ rand }}'), | |
| '{{ rand }}', | |
| document.getElementById('kb-permissions-form-{{ rand|e('js') }}'), | |
| '{{ rand|e('js') }}', |
Checklist before requesting a review
Description
Before;
After:

The display is more compact and try to avoid unnecessary informations compared to the previous iteration.
The form is cleaned up as the dropdown were a bit out of place.
One of the main goal was to hide the extra entities id / is recursive options which are not often used and create confusion for the users (we can't drop them because they are still used by few).
They are hidden by default:
And can be toggled with a button:
When the list is empty, we have a specific message: